<%--
  Created by IntelliJ IDEA.
  User: 老白
  Date: 2021/6/18
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>借书管理</title>
</head>
<body>
<div id="all">
    <div class="header container-fluid">
        <%@include file="modeHeader.jsp" %>
    </div>
    <div class="container-fluid">
        <div class="row border" style="height: 65vh;">
            <div class="col-sm-3 ">
                <%@include file="modeLeftList.jsp" %>
            </div>
            <div class="col-sm-9 border h-100 d-inline-block overflow-auto">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th scope="col">书籍名称</th>
                        <th scope="col">借书用户</th>
                        <th scope="col">借书状态</th>
                        <th scope="col">借书时间</th>
                        <th scope="col">还书时间</th>
                        <th scope="col">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="borrow" items="${borrowList}">
                        <tr>
                            <td>${borrow.bookName}</td>
                            <td>${borrow.username}</td>
                            <td>
                                <c:if test='${borrow.state == 1}'>

                                    <p class="text-primary">已归还</p>
                                </c:if>
                                <c:if test='${borrow.state == 0}'>

                                    <p class="text-danger">未归还</p>
                                </c:if>

                            </td>
                            <td>${borrow.borrowTime}</td>
                            <td>${borrow.repayTime}</td>
                            <td>
                                <c:if test="${borrow.state == 1}">
                                    无操作
                                </c:if>
                                <c:if test="${borrow.state == 0}">
                                    <a href='/borrow?type=repay&id=${borrow.id}'>还书</a>
                                </c:if>
                            </td>
                        </tr>
                    </c:forEach>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <%@include file="foot.jsp" %>
</div>
</body>
</html>
